package chapter04

import (
	"fmt"
	"net/http"

	"github.com/gin-gonic/gin"
)

// http://localhost:9000/bind_uri/hell/19/xxx
func BindUri(ctx *gin.Context) {
	var user User
	err := ctx.ShouldBindUri(&user)

	fmt.Println(user)

	if err != nil {
		ctx.String(http.StatusNotFound, "绑定失败")
	} else {
		ctx.String(http.StatusOK, "绑定成功")
	}
}
